/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.testis.gui.mvc.model.testbed;

import org.testis.gui.mvc.controller.testbed.NetworkAdapterController;
import org.testis.gui.mvc.model.AbstractModel;
import org.testis.orm.testbed.refined.NetworkAdapterRefined;

/**
 *
 * @author selcuk
 */
public class NetworkAdapterModel extends AbstractModel {

    private String m_lastError = "";
    private Boolean m_visibility = false;
    private NetworkAdapterRefined m_AdapterRefined;
    private Integer m_adapterId = 0;
    private Integer m_adapterTypeId = 0;
    private Integer m_testPcId = 0;
    private String m_name = "";

    public void setVisibility(Boolean val) {
        if (val == null) {
            return;
        }
        Boolean oldVal = m_visibility;
        m_visibility = val;
        firePropertyChange(NetworkAdapterController.VISIBLE_PROPERTY,
                oldVal,
                val);
    }

    public Boolean getVisibility() {
        return m_visibility;
    }

    public String getLastError() {
        return m_lastError;
    }

    public void setLastError(String val) {
        if (val == null) {
            val = "";
        }
        String oldValue = m_lastError;
        m_lastError = val;
        firePropertyChange(NetworkAdapterController.ERROR_PROPERTY, null,
                m_lastError);
    }

    /**
     * @return the m_testPcId
     */
    public Integer getTestPcId() {
        return m_testPcId;
    }

    /**
     * @param val the m_testPcId to set
     */
    public void setTestPcId(Integer val) {
        if (val == null) {
            return;
        }
        Integer oldVal = m_testPcId;
        this.m_testPcId = val;
        firePropertyChange(NetworkAdapterController.TEST_PC_ID_PROPERTY,
                oldVal,
                val);
    }

    /**
     * @return the m_adapterId
     */
    public Integer getAdapterId() {
        return m_adapterId;
    }

    /**
     * @param val the m_adapterId to set
     */
    public void setAdapterId(Integer val) {
        if (val == null) {
            return;
        }
        Integer oldVal = m_adapterId;
        this.m_adapterId = val;
        firePropertyChange(NetworkAdapterController.ADAPTER_ID_PROPERTY,
                oldVal,
                val);
    }

    /**
     * @return the m_name
     */
    public String getName() {
        return m_name;
    }

    /**
     * @param val the m_name to set
     */
    public void setName(String val) {
        if (val == null) {
            val = "";
        }
        String oldVal = m_name;
        this.m_name = val;
        firePropertyChange(NetworkAdapterController.NAME_PROPERTY,
                oldVal,
                val);
    }

    /**
     * @return the m_adapterTypeId
     */
    public Integer getAdapterTypeId() {
        return m_adapterTypeId;
    }

    /**
     * @param val the m_adapterTypeId to set
     */
    public void setAdapterTypeId(Integer val) {
        if (val == null) {
            return;
        }
        Integer oldVal = m_adapterTypeId;
        this.m_adapterTypeId = val;
        firePropertyChange(NetworkAdapterController.ADAPTER_TYPE_ID_PROPERTY,
                oldVal,
                val);
    }

    /**
     * @return the m_AdapterRefined
     */
    public NetworkAdapterRefined getAdapterRefined() {
        return m_AdapterRefined;
    }

    /**
     * @param val the m_AdapterRefined to set
     */
    public void setAdapterRefined(NetworkAdapterRefined val) {

        if (val == null) {
            return;
        }
        NetworkAdapterRefined oldVal = m_AdapterRefined;
        this.m_AdapterRefined = val;
        firePropertyChange(NetworkAdapterController.ADAPTER_REFINED_PROPERTY,
                oldVal,
                val);
    }
}
